<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:o="http://openfaces.org/"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<head>
</head>
<body>
	<ui:composition template="/templates/default.xhtml">
	
		<ui:define name="title">OpenHDS - Edit Out Migration</ui:define>
		
			<ui:param name="crud" value="#{outMigrationCrud}" />
			
            <ui:define name="listing">
                <ui:include src="list.xhtml" />
            </ui:define>
      		<ui:define name="display">
            
        	<h:outputText value="#{navController.breadcrumbTrail}" />
		
	        <h1>#{msg.outmigrationEdit}</h1>
	        <h:form>
	            <h:panelGrid columns="3">
	            	<h:outputText value="#{msg.individualId}:"/>
	                <h:inputText styleClass="individual" autocomplete="off" disabled="true" id="indiv" value="#{outMigrationCrud.item.individual}" converter="#{individualExtIdConverter}" />
	            	<h:message for="indiv" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	            	<h:outputText value="#{msg.outmigrationDate} (#{siteProperties.dateFormat})" />
	            	<o:dateChooser id="rec_date" value="#{outMigrationCrud.recordedDate}" disabled="true" pattern="#{siteProperties.dateFormat}" />
	            	<h:message for="rec_date" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	            	<h:outputText value="#{msg.outmigrationDestination}:"/>
	                <h:inputText id="origin" value="#{outMigrationCrud.item.destination}" />
	            	<h:message for="origin" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	            	<h:outputText value="#{msg.outmigrationReason}:"/>
	                <h:inputText id="reason" value="#{outMigrationCrud.item.reason}" />
	            	<h:message for="reason" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>
	            
	            	<h:outputText value="#{msg.fieldWorkerId}:"/>
                    <h:inputText styleClass="collectedBy" autocomplete="off" id="collectedBy" value="#{outMigrationCrud.item.collectedBy}" converter="#{fieldWorkerExtIdConverter}" />
	            	<h:message for="collectedBy" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                   	<h:outputText value="#{msg.visitId}:"/>
                   	<h:inputText styleClass="visit" autocomplete="off" id="visit" value="#{outMigrationCrud.item.visit}" converter="#{visitExtIdConverter}" />
            		<h:message for="visit" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	            </h:panelGrid>
	            <br />
	            <h:commandButton action="#{outMigrationCrud.edit}" value="#{msg.lblSave}">
	                <f:setPropertyActionListener target="#{jsfService.itemId}" value="#{outMigrationCrud.item.uuid}" />
	            </h:commandButton>
                <h:outputText value=" " />
                <h:commandButton value="#{msg.lblCancel}" immediate="true" action="cancel" rendered="#{flowScope.updating}" />
	        </h:form>
		</ui:define>
	</ui:composition>
  </body>
</html>